<stbui-search
  placeholder="输入过滤条件"
  class="mat-elevation-z4 m-b-16"
  (onSearch)="onSearchTriggered($event)"
></stbui-search>

<div class="mat-elevation-z4">
  <table mat-table [dataSource]="dataSource">
    <ng-container matColumnDef="select">
      <th mat-header-cell *matHeaderCellDef>
        <mat-checkbox
          (change)="$event ? masterToggle() : null"
          [checked]="selection.hasValue() && isAllSelected()"
          [indeterminate]="selection.hasValue() && !isAllSelected()"
        >
        </mat-checkbox>
      </th>
      <td mat-cell *matCellDef="let row">
        <mat-checkbox
          (click)="$event.stopPropagation()"
          (change)="$event ? selection.toggle(row) : null"
          [checked]="selection.isSelected(row)"
        >
        </mat-checkbox>
      </td>
    </ng-container>

    <ng-container matColumnDef="firstSeen">
      <th mat-header-cell *matHeaderCellDef>发生时间</th>
      <td mat-cell *matCellDef="let element">
        {{ element.firstSeen | date: 'yyyy-MM-dd hh:mm:ss' }}
      </td>
    </ng-container>

    <ng-container matColumnDef="src">
      <th mat-header-cell *matHeaderCellDef>资源URL</th>
      <td mat-cell *matCellDef="let element">{{ element.src }}</td>
    </ng-container>

    <ng-container matColumnDef="type">
      <th mat-header-cell *matHeaderCellDef>事件类型</th>
      <td mat-cell *matCellDef="let element">{{ element.type }}</td>
    </ng-container>

    <ng-container matColumnDef="releaseStages">
      <th mat-header-cell *matHeaderCellDef>版本</th>
      <td mat-cell *matCellDef="let element">{{ element.releaseStages }}</td>
    </ng-container>

    <ng-container matColumnDef="star" stickyEnd>
      <th mat-header-cell *matHeaderCellDef>操作</th>
      <td mat-cell *matCellDef="let element">详情</td>
    </ng-container>

    <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
    <tr
      mat-row
      *matRowDef="let row; columns: displayedColumns"
      (click)="rowSelection(row, $event)"
    ></tr>
  </table>
</div>

<error-detail
  [opened]="openDetail"
  (onOpened)="onOpenedTriggered($event)"
></error-detail>
